﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Text;

namespace UtilZ.Dotnet.Ex.Model
{
    /// <summary>
    /// 树表格节点接口
    /// </summary>
    public interface ITreeDataGridNode : ICheckItemShow
    {
        /// <summary>
        /// 获取父节点
        /// </summary>
        ITreeDataGridNode Parent { get; set; }

        /// <summary>
        /// 节点位置偏移,子节点相对父节点向右偏移量,单位/像素
        /// </summary>
        double NodeLocationOffset { get; }

        /// <summary>
        /// 该项是否框选中
        /// </summary>
        bool IsChecked { get; set; }

        /// <summary>
        /// 设置节点框选中
        /// </summary>
        /// <param name="isChecked"></param>
        void SetIsChecked(bool isChecked);

        /// <summary>
        /// 获取一个值，用以指示树节点是否处于可展开状态[true:展开;false:关闭]
        /// </summary>
        bool IsExpanded { get; set; }

        /// <summary>
        /// 由展开状态和节点显示状态决定本节点是否显示
        /// </summary>
        bool Visible { get; }

        /// <summary>
        /// 树节点展开关闭标签是否显示
        /// </summary>
        bool TagVisible { get; }

        /// <summary>
        /// 是否允许编辑
        /// </summary>
        bool AllowEdit { get; set; }


        /// <summary>
        /// 子节点集合
        /// </summary>
        ObservableCollection<ITreeDataGridNode> Nodes { get; }

        /// <summary>
        /// 获取子节点数
        /// </summary>
        int NodeCount { get; }

        /// <summary>
        /// 添加子节点
        /// </summary>
        /// <param name="node"></param>
        void AddNode(ITreeDataGridNode node);

        /// <summary>
        /// 移除子节点
        /// </summary>
        /// <param name="node">子节点</param>
        void RemoveNode(ITreeDataGridNode node);

        /// <summary>
        /// 移除当前节点
        /// </summary>
        void RemoveSelfNode();

        /// <summary>
        /// 清空子节点
        /// </summary>
        void ClearNode();

        /// <summary>
        /// 重置显示节点
        /// </summary>
        void ResetNode();

        /// <summary>
        /// 是否包含子节点
        /// </summary>
        /// <param name="node"></param>
        /// <returns></returns>
        bool Contains(ITreeDataGridNode node);
    }
}
